package top.codecrab.cloudalibaba.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.codecrab.cloudalibaba.entity.Order;
import top.codecrab.cloudalibaba.service.OrderService;
import top.codecrab.springcloud.entity.response.Result;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    /**
     * 创建订单
     */
    @GetMapping("/create")
    public Result create(Order order) {
        orderService.create(order);
        return new Result(200, "订单创建成功!");
    }
}


